package com.open.capacity.user.feign;

import com.open.capacity.common.constant.ServiceNameConstant;
import com.open.capacity.common.feign.FeignExceptionConfig;
import com.open.capacity.common.web.Result;
import com.open.capacity.user.feign.impl.PointsFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


@FeignClient(value = ServiceNameConstant.POINTS, configuration = FeignExceptionConfig.class, fallbackFactory = PointsFeignFallBack.class, decode404 = true)
public interface PointsFeign {

    /**
     * 根据用户id获取总积分值
     */
    @GetMapping("/points/userId/{userId}")
    Result<Integer> findPointsByUserId(@PathVariable long userId);

    @GetMapping("/obtain")
    Result obtain(Long userId);

}
